<%= assembly_page_header(@assembly, 'design') %>

<% page_options = [] %>
<% extract = capture do %>
  <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
    <%= icon('download', 'Extract') %> <span class="caret"></span>
  </a>
  <ul class="dropdown-menu">
    <li><%= link_to('to YAML', extract_assembly_design_path(@assembly, :format => :yaml), :target => '_blank') %></li>
    <li><%= link_to('to JSON', extract_assembly_design_path(@assembly, :format => :json), :target => '_blank') %></li>
  </ul>
<% end %>
<% page_options << extract
   if manages_assembly?(@assembly.ciId)
     if @release && @release.releaseState == 'open'
       page_options << link_to_function(icon('upload', 'Load'), '', :class => 'btn btn-small disabled')
     else
       page_options << link_to(icon('upload', 'Load'), load_assembly_design_path(@assembly), :class => 'btn btn-small')
     end
   end
   if creates_assemblies?
     page_options << link_to(icon('files-o', 'Copy'), new_clone_assembly_path(@assembly), :remote => true, :class => 'btn btn-small')
     page_options << link_to(icon('floppy-o', 'Save to Catalog'), new_clone_assembly_path(@assembly, :export => 'catalog'), :remote => true, :class => 'btn btn-small')
   end %>
<%= page_title({:page_kind     => 'Design',
                :page_label    => link_to(@assembly.ciName, assembly_path(@assembly)),
                :page_options  => page_options,
                :page_sublabel => "created by #{@assembly.createdBy}"}) %>

<%= page_info @assembly.ciAttributes.description %>

<%= render 'base/shared/page_nav_pages',
           :items => [{:label => 'summary', :template => 'summary', :selected => true},
                      {:label => 'variables', :url => assembly_design_variables_path(@assembly)},
                      {:label => 'timeline', :url => assembly_design_timeline_path(@assembly)},
                      {:label => icon('search'), :id => 'search', :template => 'search'}] %>

